package bairui.international.console.web.controller.barter.category.product;

/**
 * @see bairui.international.console.web.controller.barter.category.product.RollPage_BaseFilter
 *
 */
class RollPage_Filter

{
	
	/**
	 * 过滤扩展接口
	 */
	static interface FilterExtends {
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		bairui.international.model.domain.jpa.QTB_ProductRollImage QRoot,
		javax.servlet.http.HttpServletRequest request
	) {
		com.querydsl.core.BooleanBuilder query = query(
				QRoot
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("originalName"), 
						String.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("type"), 
						String.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("size_start"), 
						Double.class, 
						"yyyy-MM-dd"
					),
				com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("size_end"), 
						Double.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("state"), 
						com.lianjing.sh.model.uml.model.status.State_UpDown.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("createTime_start"), 
						java.util.Date.class, 
						"yyyy-MM-dd"
					),
				com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("createTime_end"), 
						java.util.Date.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("modifyTime_start"), 
						java.util.Date.class, 
						"yyyy-MM-dd"
					),
				com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("modifyTime_end"), 
						java.util.Date.class, 
						"yyyy-MM-dd"
					)
			);
			/* comment 附加过滤属性 */
	;
		return query;
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		bairui.international.model.domain.jpa.QTB_ProductRollImage QRoot
	,	String originalName
	,	String type
	,	Double size_start,
		Double size_end
	,	com.lianjing.sh.model.uml.model.status.State_UpDown state
	,	java.util.Date createTime_start,
		java.util.Date createTime_end
	,	java.util.Date modifyTime_start,
		java.util.Date modifyTime_end
	) {
		com.querydsl.core.BooleanBuilder builder = new com.querydsl.core.BooleanBuilder();
	
		if(null != originalName){
			builder.and(QRoot.originalName.eq(originalName));
		}
		if(null != type){
			builder.and(QRoot.type.like("%"+type+"%"));
		}
		if(null != size_start && null != size_end){
			builder.and(QRoot.size.between(size_start, size_end));
		}
		if(null != state){
			builder.and(QRoot.state.eq(state));
		}
		if(null != createTime_start && null != createTime_end){
			builder.and(QRoot.createTime.between(createTime_start, createTime_end));
		}
		if(null != modifyTime_start && null != modifyTime_end){
			builder.and(QRoot.modifyTime.between(modifyTime_start, modifyTime_end));
		}
		return builder;
	}
	
}
